﻿@model orienta.ViewModels.PersonaInfo
@{
    Layout = "~/Views/Shared/_LayoutPopUpPersona.cshtml";
    ViewBag.Title = "Registro Personas";
    var id = 0;
}
<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/css/wick.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.9.1.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script>

<script src="@Url.Content("~/js/ubigeo.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/funciones.js")" type="text/javascript"></script>
<script type="text/javascript">
    var dataDependencia;
    var dataUbigeo;
    var dataUbigeoDesc;
    window.onload = function () {
        calendarioFechaNac("#dtFecNac");
        cargarAutoCompleteUbigeo();
    }

</script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(false)   
           
<center>
<input type="hidden" id="tipo" name="tipo" value="@Request["tipo"]" /> 
            <div style="width:100%;">
                <table  width="100%" cellpadding="0" border="0"  cellspacing="0">
                    <tr>
                        <td>
                            <table class="tablaPrincipal_MIDIS"  width="100%" cellpadding="3" border="0"  cellspacing="0">
                                <tr>
                                    <td>
                                        <table cellpadding="0" cellspacing="0" border="0"  width="100%">
                                            <tr>
                                                <td>
                                                    <table  class="tablaTitulo_MIDIS" style="width:180PX;" cellpadding="2" cellspacing="0" border="0">
                                                        <tr>
                                                            <td  align="center">
                                                                <div id="general" class="divTitulo_MIDIS" style="width:180PX;">
                                                                    <span style="background-color:#b50055;color:white;">[REGISTRAR NUEVA PERSONA]</span>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table width="100%" class="tablaInterna_MIDIS" cellpadding="0">
                                                        <tr><td>&nbsp;</td></tr>
                                                        <tr>
                                                            <td align="center">
                                                                <table width="99%" border="1" cellpadding="3" cellspacing="0" class="tablaPrincipalSin">
                                                                    <tbody class="tituloTextNormal">
                                                                        <tr align="left">
                                                                            <td>Primer Nombre <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                            <td style="width: 2px;">:</td>
                                                                            <td>@Html.TextBoxFor(m => m.sPrimerNombre, new { @class = "cajaTextoMayuscula", @maxlength = "30", size = "12", onkeypress = "return validarSoloLetras(event);", onpaste = "return false;" })</td>
                                                                            <td>Segundo Nombre</td>
                                                                            <td style="width: 2px;">:</td>
                                                                            <td>@Html.TextBoxFor(m => m.sSegundoNombre, new { @class = "cajaTextoMayuscula", @maxlength = "30", size = "12", onkeypress = "return validarSoloLetras(event);", onpaste = "return false;" })</td>
                                                                            <td rowspan="2" valign="top">
                                                                                <table border="0" cellpadding="1" cellspacing="0" width="100%">
                                                                                    <tr align="center">
                                                                                         <td>Pa&iacute;s Documento <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                         <td>Tipo Documento <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                         <td>N&uacute;mero Docum.&nbsp;<span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                    </tr>
                                                                                    <tr align="center">
                                                                                        <td>
                                                                                            @Html.DropDownListFor(m => m.nIdePais, (IEnumerable<SelectListItem>)ViewBag.Pais)
                                                                                        </td>
                                                                                        <td>
                                                                                            @Html.DropDownListFor(m => m.nIdeTipoDoc, (IEnumerable<SelectListItem>)ViewBag.TipoDocumento, new { onchange = "insertarNroDoc(this);" })
                                                                                        </td>
                                                                                        <td>@Html.TextBoxFor(m => m.sNumDoc, new { @class = "cajaTextoMayuscula", @maxlength = "8", size = "12", onkeypress = "return validarSoloNumeros(event);", onpaste = "return false;"})</td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                        <tr align="left">
                                                                            <td>Apellido Paterno <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                            <td style="width: 2px;">:</td>
                                                                            <td>@Html.TextBoxFor(m => m.sApellidoPaterno, new { @class = "cajaTextoMayuscula", @maxlength = "30", size = "12", onkeypress = "return validarSoloLetras(event);", onpaste = "return false;" })</td>
                                                                            <td>Apellido Materno <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                            <td style="width: 2px;">:</td>
                                                                            <td>@Html.TextBoxFor(m => m.sApellidoMaterno, new { @class = "cajaTextoMayuscula", @maxlength = "30", size = "12", onkeypress = "return validarSoloLetras(event);", onpaste = "return false;" })</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td colspan="7">
                                                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                                                    <tr align="center">
                                                                                         <td>Tipo Persona <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                         <td>G&eacute;nero&nbsp;<span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                         <td>Fecha Nacimiento&nbsp;<span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                         <td>Tel&eacute;fono&nbsp;<span class="letraAsterisco_MIDIS"></span></td>
                                                                                         <td>Tel&eacute;fono2&nbsp;<span class="letraAsterisco_MIDIS"></span></td>
                                                                                         <td>Correo&nbsp;Electr&oacute;nico&nbsp;</td>
                                                                                    </tr>
                                                                                    <tr align="center">
                                                                                        <td>
                                                                                            @Html.DropDownListFor(m => m.nIdeTipoPers, (IEnumerable<SelectListItem>)ViewBag.TipoPersona)
                                                                                        </td>
                                                                                        <td>
                                                                                            @Html.DropDownListFor(m => m.nIdeGenero, (IEnumerable<SelectListItem>)ViewBag.TipoGeneroPersona)
                                                                                        </td>
                                                                                        <td>
                                                                                            <table border="0" cellpadding="0" cellspacing="0">
                                                                                                    <tr>
                                                                                                        <td>
                                                                                                        @Html.TextBoxFor(m => m.dtFecNac, new { @maxlength = "10", style = "width:88px", ondblclick = "javascript:limpiaCajaDobleClick(this)" })
                                                                                                        </td>
                                                                                                    </tr>
                                                                                            </table>                                                                                    
                                                                                        </td>
                                                                                        <td>
                                                                                            @Html.TextBoxFor(m => m.sNumTelf1, new { @class = "cajaTextoMayuscula", @maxlength = "20", size = "12", onkeypress = "return validarSoloNumeros(event);", onpaste = "return false;" })
                                                                                        </td>
                                                                                        <td>
                                                                                            @Html.TextBoxFor(m => m.sNumTelf2, new { @class = "cajaTextoMayuscula", @maxlength = "20", size = "12", onkeypress = "return validarSoloNumeros(event);", onpaste = "return false;" })
                                                                                        </td>
                                                                                        <td>@Html.TextBoxFor(m => m.sEmail, new { @class = "cajaTextoMinuscula", @maxlength = "30", size = "12" })</td>
                                                                                       
                                                                                    </tr>
                                                                                   
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>Discapacidad</td>
                                                                            <td>:</td>
                                                                            <td colspan="5" align="left">
                                                                                <table cellpadding="0" cellspacing="0" border="0" width="90%">
                                                                                @foreach (var item in ViewBag.Discapacidad)
                                                                                {
                                                                                    <tr>
                                                                                        <td>@item.vNomCorto</td>
                                                                                        <td style="width: 10px;" align="center">:</td>
                                                                                        <td><input type="checkbox" id="discapacidad" name="discapacidad" value="@item.nIdeDetalle"  /></td>
                                                                                    </tr>
                                                                                }
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                        </tr>
                                                        <tr><td><img src="@Url.Content("~/images/space.gif")" id="imgSpace1" alt="Space" width="2px" height="2px" /></td></tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr><td><img src="@Url.Content("~/images/space.gif")" id="imgSpace1" alt="Space" width="2px" height="2px" /></td></tr>
                            </table>
                        </td>
                    </tr>
                    <tr><td><img src="@Url.Content("~/images/space.gif")" id="imgSpace2" alt="Space" width="2px" height="2px" /></td></tr>
                    <tr>
                        <td>
                            <table class="tablaPrincipal_MIDIS"  width="100%" cellpadding="3" border="0"  cellspacing="0">
                                <tr>
                                    <td>
                                        <table cellpadding="0" cellspacing="0" border="0"  width="98%">
                                            <tr>
                                                <td>
                                                    <table  class="tablaTitulo_MIDIS" style="width:180PX;" cellpadding="2" cellspacing="0" border="0">
                                                        <tr>
                                                            <td  align="center">
                                                                <div id="divDireccion" class="divTitulo_MIDIS" style="width:180PX;">
                                                                    <span style="background-color:#b50055;color:white;">[DIRECCI&Oacute;N DE LA PERSONA]</span>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table width="100%" class="tablaInterna_MIDIS" cellpadding="0">
                                                        <tr><td><img src="@Url.Content("~/images/space.gif")" id="imgSpace4" alt="Space" width="2px" height="2px" /></td></tr>
                                                        <tr>
                                                            <td align="center">
                                                                <table width="98%" border="1" cellpadding="5" cellspacing="0" class="tablaPrincipalSin">
                                                                    <tbody class="tituloTextNormal">
                                                                        <tr>
                                                                            <td>
                                                                                <table width="100%" border="0" cellpadding="3" cellspacing="0">
                                                                                    <tr>
                                                                                        <td>Tipo V&iacute;a <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                        <td>Nombre de V&iacute;a <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                        <td>N&uacute;mero</td>
                                                                                        <td>Dept.</td>
                                                                                        <td>Interior</td>
                                                                                        <td>MZ</td>
                                                                                        <td>Lote</td>
                                                                                        <td>KM</td>
                                                                                        <td># block</td>
                                                                                        <td>Etapa</td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td>
                                                                                        @Html.DropDownListFor(m => m.PersonaDireccion.nIdeTipoVia, (IEnumerable<SelectListItem>)ViewBag.TipoVia, "--Seleccione--")
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sNombreVia, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "14", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sNumeroVia, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "10", onkeypress = "return validarSoloNumeros(event);", onpaste = "return false;" })
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sDepartamento, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "10", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sInterior, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "10", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;" })
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sManzana, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "10", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;" })
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sLote, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "10", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sKm, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "10", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sBlock, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "10", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sEtapa, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "10", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                                                    <tr>
                                                                                        <td>Tipo Zona <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                        <td>Nombre de Zona</td>
                                                                                        <td>Departamento <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                        <td>Provincia <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                        <td>Distrito <span class="letraAsterisco_MIDIS">(*)</span></td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td>
                                                                                        @Html.DropDownListFor(m => m.PersonaDireccion.nIdeTipoZona, (IEnumerable<SelectListItem>)ViewBag.TipoZona, "--Seleccione--")
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sNombreZona, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "12", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.DropDownListFor(m => m.PersonaDireccion.sUbigeoDepartamento, Enumerable.Empty<SelectListItem>(), new { onchange = "javascript:cargarProvincias(this);" })
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.DropDownListFor(m => m.PersonaDireccion.sUbigeoProvincia, Enumerable.Empty<SelectListItem>(), new { onchange = "javascript:cargarDistritos(this);" })
                                                                                        </td>
                                                                                        <td>
                                                                                        @Html.DropDownListFor(m => m.PersonaDireccion.sUbigeoDistrito, Enumerable.Empty<SelectListItem>())
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                                                    <tr>
                                                                                        <td>Centro Poblado</td>
                                                                                        <td>&nbsp;</td>
                                                                                        <td>Referencia &nbsp;(1)</td>
                                                                                        <td>&nbsp;</td>
                                                                                        <td>Referencia &nbsp;(2)</td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sCentroPoblado, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "12", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                        <td>&nbsp;</td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sReferencia1, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "12", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                        <td>&nbsp;</td>
                                                                                        <td>
                                                                                        @Html.TextBoxFor(m => m.PersonaDireccion.sReferencia2, new { @class = "cajaTextoMayuscula", @maxlength = "100", size = "12", onkeypress = "return validaCaracterV2(event);", onpaste = "return false;"})
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                        </tr>
                                                        <tr><td>&nbsp;</td></tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table border="0" cellpadding="5" cellspacing="0" width="80%">
                                                        <tbody class="letraLink_MIDIS">
                                                            <tr align="left">
                                                                <td><b>campo obligatorio:</b>&nbsp;<span class="letraAsterisco">(*)</span></td>
                                                                <td><input type="submit" value="Registrar"  name="btnNuevo" class="boton" /></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
        </center> 

}

<div id="divUbigeo" style="display:none"></div>